package com.chis.shardingjdbc.dao;


import com.chis.shardingjdbc.beans.TdJxcStmtzx;
import com.chis.shardingjdbc.dto.ShardDTO;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Description 数据查询更新基类
 * @Company zwx
 * @author jw
 * @date 2016年11月28日
 */
public  class ShardjdbcDao {
	/** 物理库数据源 */
	@Resource
	protected ShardDTO dto;

	public List<Map<Object, Object>> test() throws Exception{
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
		return dto.test(sdf.parse("20200101"),sdf.parse("20200630"));
	}

	public void saveTz(List<TdJxcStmtzx> list ) throws Exception{
		dto.insertJxcStmtzx(list);
	}

	public void updateTz(String guids, Date date) throws Exception{
		dto.updateStmtzx(guids,date);
	}

	public List<TdJxcStmtzx> selectTz(Date date) throws Exception{
		return dto.findTz(date);
	}

	public List<Map<Object, Object>> selectTz2(Date date1, Date date2) throws Exception{
		return dto.findTz2(date1,date2);
	}

	public List<Map<Object,Object>> selectTz3(Date date1, Date date2)  throws Exception{
		return dto.findTz3(date1,date2);
	}

}